package Application.controller;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import Application.entity.Collect;
import Application.entity.Result;
import Application.service.CollectService;

@CrossOrigin	
@RestController
@RequestMapping("/Collect")
public class CollectControl {

	
	@Resource
	private CollectService service;
	
	
	@PostMapping("/addCollect")
	public Result  addcollect(Collect collect) {
		return service.addCollect(collect);
	} 
	
	@PostMapping("/removeCollect")
	public Result removeCollect(int id) {
		return service.removeCollect(id);
	}
	
	
	@PostMapping("/findUserCollect")
	public List<Collect> findUserCollect(int id){
		return service.findUserCollect(id);
	}
}
